package com.ruyuan.o2o.groupbuy.common.log.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 初始化配置日志拦截器
 *
 * @author ming qian
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Bean
    public InvocationIdInterceptor init() {
        return new InvocationIdInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(init()).addPathPatterns("/**");
    }

}
